xcsv. Adds gpsdrivetrack and openoffice formats.
/* altitude in meters as a decimal value */
wpt->altitude = atof(s);
} else
+
+ /* PATH CONVERSIONS ************************************************/
+ if (strcmp(fmp->key, "PATH_SPEED") == 0) {
+ wpt->speed = atof(s);
+ } else
+ if (strcmp(fmp->key, "PATH_COURSE") == 0) {
+ wpt->course = atof(s);
+ } else
/* TIME CONVERSIONS ***************************************************/
if (strcmp(fmp->key, "EXCEL_TIME") == 0) {
wpt->gc_data.placer = csv_stringtrim(s, "", 0);
} else
+ /* GPS STUFF *******************************************************/
+ if (strcmp(fmp->key, "GPS_HDOP") == 0) {
+ wpt->hdop = atof(s);
+ } else
+ if (strcmp(fmp->key, "GPS_VDOP") == 0) {
+ wpt->vdop = atof(s);
+ } else
+ if (strcmp(fmp->key, "GPS_PDOP") == 0) {
+ wpt->pdop = atof(s);
+ } else
+ if (strcmp(fmp->key, "GPS_SAT") == 0) {
+ wpt->sat = atoi(s);
+ } else
+ if (strcmp(fmp->key, "GPS_FIX") == 0) {
+ wpt->fix = atoi(s)-1;
+ if ( wpt->fix < fix_2d) {
+ if (!strcasecmp(s, "none"))
+ wpt->fix = fix_none;
+ else if (!strcasecmp(s, "dgps"))
+ wpt->fix = fix_dgps;
+ else if (!strcasecmp(s, "pps"))
+ wpt->fix = fix_pps;
+ else
+ wpt->fix = fix_unknown;
+ }
+ } else
+
/* OTHER STUFF ***************************************************/
if ( strcmp( fmp->key, "PATH_DISTANCE_MILES") == 0) {
/* Ignored on input */
/* path (route/track) distance in */
writebuff( buff, fmp->printfc, pathdist * 5280*12*2.54/100/1000 );
} else
+ if (strcmp(fmp->key, "PATH_SPEED") == 0) {
+ writebuff( buff, fmp->printfc, wpt->speed );
+ } else
+ if (strcmp(fmp->key, "PATH_COURSE") == 0) {
+ writebuff( buff, fmp->printfc, wpt->course );
+ } else
/* TIME CONVERSIONS**************************************************/
if (strcmp(fmp->key, "EXCEL_TIME") == 0) {
} else
if (strcmp(fmp->key, "GEOCACHE_PLACER") == 0) {
writebuff(buff, fmp->printfc, NONULL(wpt->gc_data.placer));
- } else {
- /* this should probably never happen */
+ } else
+
+ /* GPS STUFF *******************************************************/
+ if (strcmp(fmp->key, "GPS_HDOP") == 0) {
+ writebuff(buff, fmp->printfc, wpt->hdop);
+ } else
+ if (strcmp(fmp->key, "GPS_VDOP") == 0) {
+ writebuff(buff, fmp->printfc, wpt->vdop);
+ } else
+ if (strcmp(fmp->key, "GPS_PDOP") == 0) {
+ writebuff(buff, fmp->printfc, wpt->pdop);
+ } else
+ if (strcmp(fmp->key, "GPS_SAT") == 0) {
+ writebuff(buff, fmp->printfc, wpt->sat);
+ } else
+ if (strcmp(fmp->key, "GPS_FIX") == 0) {
+ char *fix = NULL;
+ switch (wpt->fix) {
+ case fix_unknown:
+ fix = "Unknown";
+ break;
+ case fix_none:
+ fix = "None";
+ break;
+ case fix_2d:
+ fix = "2d";
+ break;
+ case fix_3d:
+ fix = "3d";
+ break;
+ case fix_dgps:
+ fix = "dgps";
+ break;
+ case fix_pps:
+ fix = "pps";
+ break;
+ }
+ writebuff(buff, fmp->printfc, fix);
+ } else
+
+ {
+ /* this should probably never happen */
}
+
obuff = csv_stringclean(buff, xcsv_file.badchars);
fprintf (xcsv_file.xcsvfp, "%s", obuff);
PATH_DISTANCE_KM is like PATH_DISTANCE_MILES except it outputs the
length in kilometers.
+ o PATH_SPEED
+ Speed in meters per second. Gpsbabel does NOT calculate this data, it is
+ read from the input file if present.
+
+ example: PATH_SPEED,"","%f"
+
+ o PATH_COURSE
+ Course in degerees. Gpsbabel does NOT calculate this data, it is
+ read from the input file if present.
+
+ example: PATH_COURSE,"","%f"
+
+ o GPS_HDOP, GPS_VDOP, GPS_PDOP
+ GPS distorsion of position parameters. Needs float conversion.
+
+ example: GPS_HDOP,"","%f"
+
+ o GPS_SAT
+ Number of satellites used for determination of the position. Needs
+ interger conversion.
+
+ example: GPS_SAT,"","%d"
+
+ o GPS_FIX
+ Type of fix (see GPX spec). Needs string conversion.
+
+ example: GPS_FIX,"","%s"
+
EXAMPLES:
--------
For examples on using the XCSV module, please see the *.style files in
--- /dev/null
+# gpsbabel XCSV style file
+#
+# Format: GPSDriveTrack
+# Author: Tobias Minich
+# Date: 12/07/2005
+#
+#
+#
+
+DESCRIPTION GpsDrive Format for Tracks
+
+# FILE LAYOUT DEFINITIIONS:
+#
+FIELD_DELIMITER WHITESPACE
+RECORD_DELIMITER NEWLINE
+BADCHARS ,'"
+
+SHORTLEN 20
+SHORTWHITE 0
+
+#
+# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:
+
+OFIELD LAT_DECIMAL, "", "%10.6f"
+OFIELD LON_DECIMAL, "", "%10.6f"
+OFIELD ALT_METERS, "", "%10.0f"
+OFIELD GMT_TIME, "", "%a %b %d %T %Y"
--- /dev/null
+# gpsbabel XCSV style file
+#
+# Format: Tab delimitered csv useful for OpenOffice, Ploticus etc.
+# Author: Tobias Minich
+# Date: 07/18/2005
+#
+#
+
+DESCRIPTION Custom "Everything" Style
+
+# FILE LAYOUT DEFINITIIONS:
+#
+FIELD_DELIMITER TAB
+RECORD_DELIMITER NEWLINE
+BADCHARS TAB
+FORMAT_TYPE INTERNAL
+
+#
+# HEADER STUFF:
+#
+PROLOGUE Index Lat Lon Icon Name Description Notes URL Link Text Altitude (m) Distance (km) Speed (m/s) Course (°) Time HDOP VDOP PDOP Satellites Fix
+
+#
+# INDIVIDUAL DATA FIELDS:
+#
+IFIELD INDEX, "", "%d"
+IFIELD LAT_DECIMAL, "", "%f"
+IFIELD LAT_DIR, "", "%c"
+IFIELD LAT_HUMAN_READABLE, "", "%d° %f' %c"
+IFIELD LON_DECIMAL, "", "%f"
+IFIELD LON_DIR, "", "%c"
+IFIELD LON_HUMAN_READABLE, "", "%d° %f' %c"
+IFIELD ICON_DESCR, "", "%s"
+IFIELD SHORTNAME, "", "%s"
+IFIELD DESCRIPTION, "", "%s"
+IFIELD NOTES, "", "%s"
+IFIELD URL, "", "%s"
+IFIELD URL_LINK_TEXT, "", "%s"
+IFIELD ALT_METERS, "", "%f"
+IFIELD PATH_DISTANCE_KM, "", "%f"
+IFIELD PATH_SPEED, "", "%f"
+IFIELD PATH_COURSE, "", "%f"
+IFIELD EXCEL_TIME, "", "%f"
+IFIELD GPS_HDOP, "", "%f"
+IFIELD GPS_VDOP, "", "%f"
+IFIELD GPS_PDOP, "", "%f"
+IFIELD GPS_SAT, "", "%d"
+IFIELD GPS_FIX, "", "%s"